#define   _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
int main()
{
	int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o;
	scanf("%d %d %d %d %d %d %d %d %d %d", &a, &b, &c, &d, &e, &f, &g, &h, &i, &j);
	k = (a > b) ? a : b;
	l = (c > d) ? c : d;
	m = (e > f) ? e : f;
	n = (g > h) ? g : h;
	o = (i > j) ? i : j;
	int p, q;
	p = (k > l) ? k : l;
	q = (m > n) ? m : n;
	int r;
	r = (p > q) ? p : q;
	int s;
	s = (r > o) ? r : o;
	 
	printf("%d", s);
	return 0;
}